let dict = ["spider": 8, "ant": 6, "cat": 4]

for item in dict {
    print(item) // item是元祖
}
print("--------------------------------")

for (key, value) in dict {
    print(key, "---", value) // 元祖解构赋值
}
print("--------------------------------")

// 带步长的遍历(开区间)
let step = 5
for i in stride(from: 0, to: 50, by: step) {
    print(i)
}
print("--------------------------------")

// 带步长的遍历(闭区间)
for i in stride(from: 0, through: 50, by: step) {
    print(i)
}
print("--------------------------------")
